VERSION 5.00
Begin VB.Form frmventasCaidasNivelContrato 
   BackColor       =   &H80000013&
   BorderStyle     =   5  'Sizable ToolWindow
   Caption         =   "Contratos con saldo en rojo"
   ClientHeight    =   1875
   ClientLeft      =   60
   ClientTop       =   330
   ClientWidth     =   7380
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   1875
   ScaleWidth      =   7380
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton CmdSalir 
      BackColor       =   &H0080FFFF&
      Caption         =   "&Salir"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   6120
      Picture         =   "frmventasCaidasNivelContrato.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1080
      Width           =   735
   End
   Begin VB.CommandButton cmdImprimir 
      BackColor       =   &H0000FFFF&
      Caption         =   "Imprimir"
      Height          =   615
      Left            =   5160
      Picture         =   "frmventasCaidasNivelContrato.frx":058A
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   1080
      Width           =   732
   End
   Begin VB.TextBox txtCodigoContrato 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   480
      Width           =   1455
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "Asesor de Venta"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00800000&
      Height          =   255
      Left            =   1920
      TabIndex        =   5
      Top             =   240
      Width           =   1455
   End
   Begin VB.Label lblAsesorVentas 
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00800000&
      Height          =   375
      Left            =   1920
      TabIndex        =   4
      Top             =   600
      Width           =   5175
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "Contrato"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00800000&
      Height          =   255
      Left            =   240
      TabIndex        =   3
      Top             =   240
      Width           =   1215
   End
End
Attribute VB_Name = "frmventasCaidasNivelContrato"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdImprimir_Click()


    If txtCodigoContrato.Text = "" Then
        Exit Sub
    End If
    

    RutaReportes = DE.rsGENCParametros.Fields("RUTA_REPORTES")
    MDI.reporte.StoredProcParam(0) = RTrim(UCase(txtCodigoContrato))
'    MDI.reporte.StoredProcParam(1) = RTrim(UCase(txtCodigoContrato))
    Imprimir RutaReportes & "VentasCaidaNivelProducto.rpt", "", "", "", ""
End Sub

Private Sub cmdSalir_Click()
    Unload Me
End Sub

Private Sub Form_Load()
 Left = Screen.Width / 2 - Width / 2
    Top = (Screen.Height / 2 - Height / 2) - 800
    
End Sub

Private Sub txtCodigoContrato_KeyDown(KeyCode As Integer, Shift As Integer)
HacerTab KeyCode
End Sub

Private Sub txtCodigoContrato_LostFocus()
    'busco que el contrato tenga valores tomados
    
    On Error Resume Next
    If txtCodigoContrato.Text = "" Then
       MsgBox "Este campo no debe quedar vacio..."
        Exit Sub
    
    End If
    
   
    If DE.rscontratoVT.State = adStateOpen Then DE.rscontratoVT.Close
    DE.contratoVT UCase(txtCodigoContrato)
    
    If DE.rscontratoVT.EOF Then
        MsgBox "Numero de Contrato No existe....."
        txtCodigoContrato.Text = ""
        txtCodigoContrato.SetFocus
        Exit Sub
    End If
    
    With DE.rscontratoVT
        
        lblAsesorVentas.Caption = .Fields("nombres")

        
    End With

End Sub
